<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
    <title>缩放过渡</title>
    <style>
        p {
            font: 30px "微软雅黑";
            margin: 30px auto;
            font-weight: 500;
            color: #f35626;
        }

        .scaling-enter-active {
            animation: scaling 1s;
        }

        .scaling-leave-active {
            animation: scaling 1s reverse;
        }

        @keyframes scaling {
            0% {
                transform: scale(0);
            }

            50% {
                transform: scale(1.2);
            }

            100% {
                transform: scale(1);
            }
        }
    </style>
</head>

<body>
    <div id="box" align="center">
        <button v-on:click="show=!show">切换显示</button>
        <transition name="scaling">
            <p v-if="show">机会总是留给有准备的人</p>
        </transition>
    </div>
    <script>
        new Vue({
            el: "#box",
            data: {
                show: true
            }
        })
    </script>
</body>

</html>